<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <canvas id="cont" width="1000px" , height="1000px">您的浏览器版本太低，不支持画布，请更新浏览器</canvas>
    <script>
        //固定的两步
        var canvas = document.querySelector('#cont')
        var ctx = canvas.getContext('2d')

        var deg = Math.PI * 2 / 360
        var count = 0

        var timer = setInterval(function () {
            count ++
            ctx.beginPath()
            ctx.arc(250, 250, 200, -Math.PI/2, count*deg-Math.PI/2, false)
            ctx.lineWidth = 10
            ctx.strokeStyle = 'red'
            ctx.stroke()
            if(count==360) {
                clearInterval(timer)
            }
        },5)
    </script>
</body>

</html>